package chainresponsibility.p6;

public class Application {
    private Handler useInt, useLong, useBig;    // 责任链上的对象

    public void setupChain() { // 建立责任链
        useInt = new UseInt();
        useLong = new UseLong();
        useBig = new UseBigInteger();
        useInt.setNextHandler(useLong);
        useLong.setNextHandler(useBig);
    }

    public void responseClient(String number) { // 响应用户的请求
        useInt.computeMultiply(number);
    }

    public static void main(String args[]) {
        Application application = new Application();
        application.setupChain();
        application.responseClient("32");
    }
}